package org.jeecg.modules.hotel.arrangement.util;

import org.jeecgframework.poi.excel.entity.params.ExcelExportEntity;

import java.util.ArrayList;
import java.util.List;

/**
 *
 */
public class ExcelImports {
    public static List<ExcelExportEntity> ExcelImportUtil(int maxUpperWeek, int maxLowerWeek){
        List<ExcelExportEntity> entityList = new ArrayList<>();
        ExcelExportEntity e9 = new ExcelExportEntity("房间号","roomNames");
        ExcelExportEntity e2 = new ExcelExportEntity("宿舍号","roomName");
        ExcelExportEntity e16 = new ExcelExportEntity("辅导员","studentTeacher");
        entityList.add(e9);
        entityList.add(e2);
        entityList.add(e16);


        ExcelExportEntity e4 = new ExcelExportEntity("上半年", "linkman", true);

        List<String> sub = new ArrayList<>();
        for (int i = 1; i <=  maxUpperWeek; i++) {
            String a = "第" + i + "周";
            // 创建第i周的表头
            ExcelExportEntity weekEntity = new ExcelExportEntity(a, i + "totalScore", true);
            entityList.add(weekEntity);
            ExcelExportEntity e3 = new ExcelExportEntity("等级",i+"link_totalScore",true);
            ExcelExportEntity e8 = new ExcelExportEntity("分值",i+"link_totalScores",true);
            entityList.add(e3);
            entityList.add(e8);
            sub.add(i + "totalScore");
            sub.add(i+"link_totalScore");
            sub.add(i+"link_totalScores");

        }
        e4.setSubColumnList(sub);
        entityList.add(e4);


// 创建下半年的表头
       ExcelExportEntity e5 = new ExcelExportEntity("下半年", "1,", true);
        List<String> lowerSubb = new ArrayList<>();
        for (int j = 1; j <= maxLowerWeek; j++) {
            String a = "第" + j + "周";
            ExcelExportEntity weekEntity = new ExcelExportEntity(a,    j + "total_score", true);
            entityList.add(weekEntity);
            ExcelExportEntity e33 = new ExcelExportEntity("等级",j+"link_totalScoreBee",true);
            ExcelExportEntity e88= new ExcelExportEntity("分值",j+"link_totalScoresBee",true);
            entityList.add(e33);
            entityList.add(e88);
            lowerSubb.add(j + "total_score");
            lowerSubb.add(j+"link_totalScoreBee");
            lowerSubb.add(j+"link_totalScoresBee");
        }
        e5.setSubColumnList(lowerSubb);
        entityList.add(e5);


        ExcelExportEntity e10 = new ExcelExportEntity("A数量","ACount");
        ExcelExportEntity e11 = new ExcelExportEntity("B数量","BCount");
        ExcelExportEntity e12 = new ExcelExportEntity("C数量","CCount");
        ExcelExportEntity e13 = new ExcelExportEntity("D数量","DCount");
        ExcelExportEntity e14 = new ExcelExportEntity("成绩","pjcj");
        ExcelExportEntity e15 = new ExcelExportEntity("违纪情况","remark");
        entityList.add(e10);
        entityList.add(e11);
        entityList.add(e12);
        entityList.add(e13);
        entityList.add(e14);
        entityList.add(e15);
        return entityList;
    }
}
